export default {
  includes(list, key, data) {
    return list.filter((item) => {
      return String(item[key]).includes(String(data));
    });
  },
  noIncludes(list, key, data){
    return list.filter((item) => {
      return !String(item[key]).includes(String(data));
    });
  },
  "="(list, key, data) {
    return list.filter((item) => {
      return Object.is(String(item[key]), String(data));
    });
  },
  "!="(list, key, data) {
    return list.filter((item) => {
      return !Object.is(String(item[key]), String(data));
    });
  },
  ">"(list, key, data) {
    return list.filter((item) => {
      return Number(item[key]) - Number(data) > 0;
    });
  },
  "<"(list, key, data) {
    return list.filter((item) => {
      return Number(item[key]) - Number(data) < 0;
    });
  },
  "!="(list, key, data) {
    return list.filter((item) => {
        return !Object.is(String(item[key]), String(data));
      });
  },
  "start"(list, key, data){
    return list.filter((item) => {
      return String(item[key]).startsWith(data);
    });
  },
  "noStart"(list, key, data){
    return list.filter((item) => {
      return !String(item[key]).startsWith(data);
    });
  },
  "end"(list, key, data){
    return list.filter((item) => {
      return String(item[key]).endsWith(data);
    });
  },
  "noEnd"(list, key, data){
    return list.filter((item) => {
      return !String(item[key]).endsWith(data);
    });
  }
};
